﻿
<%@ Page language="c#" Inherits="Mysoft.Crm.Web.Tools.ObjectManager" CodeBehind="Mysoft.Crm.Application.Pages.Tools.dll" %>
<%@ Register TagPrefix="cnt" Namespace="Mysoft.Crm.Application.Controls" Assembly="Mysoft.Crm.Application.Components" %>
<%@ Register TagPrefix="mnu" Namespace="Mysoft.Crm.Application.Menus" Assembly="Mysoft.Crm.Application.Components" %>
<%@ Register TagPrefix="crm" Namespace="Mysoft.Crm.Controls" Assembly="Mysoft.Crm.Application.Components" %>
<%@ Import Namespace="Mysoft.Crm" %>
<html>
<head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312"/>
<!--<cnt:AppHeader runat="server" id="crmHeader"/>-->

<link rel="stylesheet" type="text/css" href="/_nav/menu.css">
<script language="javascript" src="/_grid/action.js"></script>
<link rel="stylesheet" type="text/css" href="/_grid/grid.css">
<link rel="stylesheet" type="text/css" href="/_common/styles/global.css">
<script language="javascript" src="/_controls/util/util.js"></script>
<script language="javascript" src="/_common/scripts/global.js"></script>

<link rel="stylesheet" type="text/css" href="/_nav/taskBox.css">
<link rel="stylesheet" type="text/css" href="/_controls/navigation/map.css">
<script language="JavaScript" src="/_grid/action.js"></script>

<script language="JavaScript">

	var _sDefaultViewId = "<%=_defaultViewId%>";

	function setDefaultView()
	{
		if (crmGrid._iTotalRecords == 0)
		{
			//alert( "There are currently no views available to set as the default view. You must first create a new view." );
			alert( "当前没有可用作为默认的视图，你必须创建一个新视图。" );
			return false;
		}
		
		_sDefaultViewId = openStdDlg("/tools/vieweditor/dialogs/SetDefaultView.aspx?objectTypeCode=" + <%=_objectTypeCode%>, null, 400, 240);
	}

	function createNewView()
	{		
		openStdWin("/tools/vieweditor/viewManager.aspx?objectTypeCode=<%=_objectTypeCode%>&mode=new", "ViewManagerEditor", 800, 400);		
	}

	function defaultViewSelected()
	{
		var oList = getSelected("crmGrid");
	
		if (oList)
		{
			for (var i=0; i<oList.length; i++)
			{
				if (_sDefaultViewId == oList[i]) return true;
			}
		}

		return false;
	}


	function deleteView()
	{
		if (!defaultViewSelected())
		{
			doAction('crmGrid','<%= Util.SavedQuery %>', 'delete')
		}
		else
		{
			alert ( "你不能删除默认视图，除非你把另一个视图设为默认视图。" );
			//alert ( "You cannot delete a default view until you have specified another view as the default." );

		}
	}
	
	function customizeForm()
	{
		openStdWin('/tools/formEditor/formEditor.aspx?objectTypeCode=<%=_objectTypeCode%>', 'formEditor', 750, 530);
	}
	
</script>

</head>
<body>

	<table width="100%" height="100%" cellspacing="0" cellpadding="0" style="table-layout:fixed;">
	<col width="192"><col>
		<tr height="50">
			<td colspan="2" style="padding-left:13px;padding-right:15px;">
				<div class="subtitle">定制您想要的类型</div><!-What would you like to customize?->
				<img src="/tools/_imgs/hr.gif" align="middle" height="1" width="100%" style="margin-bottom:10px;"/>
			</td>
		</tr>
		<tr>
			<td style="padding:20px;padding-top:0px;">
				<crm:TaskBox runat="server" id="crmTaskBox"/>
			</td>
			<td style="padding:10px;padding-top:0px;padding-left:14px;padding-bottom:20px;">
				
				<table width="100%" height="100%" cellpadding="0" cellspacing="0" style="table-layout:fixed;">
				<col width="113"><col><col width="113">
					<tr height="80">
						<td style="vertical-align:top;"><img src="imgs/form_watermark.gif"></td>
						<td colspan="2" style="vertical-align:top;padding-left:15px;">
							<span style="font-size:14px;font-weight:bold;color:#37377C; border-bottom:solid 1px #D4D4D0;">
								<!-Customize the->定制<%=Util.GetFmtObjName(int.Parse(_objectTypeCode), Util.NameFormatStyle.Singular)%>表单 <!-Form->
							</span>
							<br>
							<div style="padding-top:6px;color:#666666;"><!-Modify the->修改<%=Util.GetFmtObjName(int.Parse(_objectTypeCode), Util.NameFormatStyle.Singular)%>表单时请点击<!- form by clicking -><a href="javascript:customizeForm();void(0);" style="color:#0000ff;"><!-Customize Form->定制表单</a> <!-on the left. From here you can add, modify, and remove existing and custom fields to this form.-></div>
						</td>
					</tr>
<%
				if (_defaultViewId != String.Empty)
				{
%>
					<tr height="53">
						<td colspan="2" style="vertical-align:top;">
							<span style="font-size:14px;font-weight:bold;color:#37377C; border-bottom:solid 1px #D4D4D0;">
								<!-Customize ->定制<%=Util.GetFmtObjName(int.Parse(_objectTypeCode), Util.NameFormatStyle.Singular)%><!- Views->视图
							</span>
							<br>
							<div style="padding-top:6px;color:#666666;">修改当用户打开<!-Modify the views that users see when they open the -><%=Util.GetFmtObjName(int.Parse(_objectTypeCode), Util.NameFormatStyle.Singular)%><!- list page.->列表页时看到视图</div>
						</td>
						<td><img src="imgs/view_watermark.gif"></td>
					</tr>
					<tr height="25">
						<td colspan="3"><mnu:AppGridMenuBar runat="server" id="crmMenuBar"/></td>
					</tr>
					<tr>
						<td colspan="3"><cnt:AppGrid id="crmGrid" runat="server"/></td>
					</tr>
<%
				}
%>

				</table>

			</td>
		</tr>	
	</table>
<%
	=RaiseCreateNewView
%>
</body>
</html>